$(document).ready(function() {		
    var userLevelHtml="";
    $.ajax({
        url: "usertype/getusertypes", 
        async: true, 
        success: function(data) {
            if (typeof data == 'object') {
                var userlevels=data['userlevels'];
                for(var i=0;i<userlevels.length;i++){
                    var userlevel=userlevels[i];
                    userLevelHtml+="<tr><td>"+userlevel.name+"</td>";
                    userLevelHtml+="<td>"+userlevel.description+"</td>";
                    userLevelHtml+="<td>"+userlevel.id+"</td>";
                    userLevelHtml+="<td><a href='#' onclick='updateUserLevel(\""+userlevel.id+"\")'>Update "+userlevel.name+"</a></td>";
                    userLevelHtml+="</tr>";
                }
                $("#userlevellist").html(userLevelHtml);
            }
        }
    });
});
function updateUserLevel(id){ 
}